﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using SmartCity.Shared;
using Volo.Abp.Domain.Entities;

namespace CommonManagement
{
    /// <summary>
    /// 充值记录类
    /// </summary>
    public class Recharge : Entity<int>
    {
        /// <summary>用户编号</summary>
        public int UserId { get; protected set; }

        /// <summary>充值金额</summary>
        public int Money { get; protected set; }

        /// <summary>充值时间</summary>
        public DateTime RechargeDate { get; protected set; }

        /// <summary>充值方式</summary>
        public PaymentType? PayType { get; protected set; }

        /// <summary>用户</summary>
        [ForeignKey("UserId")]
        public User User { get; protected set; }

        private Recharge() { }

        internal Recharge(
            int userId,
            int money,
            PaymentType? payType)
        {
            UserId = userId;
            Money = money;
            RechargeDate = DateTime.Now;
            PayType = payType;
        }
    }
}